package com.sciener.service;

import java.util.List;

import com.sciener.dao.TypeDaoImp;
import com.sciener.entity.Type;

public class TypeService {
	TypeDaoImp typeDao = new TypeDaoImp();
	
	public void inserte(Type type)
	{
		typeDao.insertType(type);
	}
	
	public List<Type> getAllTypes()
	{
		return typeDao.getAllTypes();
	}
	
	public void deleteType(Type type)
	{
		typeDao.deleteType(type);
	}
	
	public static void main(String[] args) {
		TypeService service = new TypeService();
		
	/*	Type type = new Type();
		type.setDescrib("abc");
		service.inserte(type);
	*/	
		List<Type> types = service.getAllTypes();
		System.out.println(types.size());
		
		for(Type type1 : types)
		{
			if(type1.getDescrib().equals("abc"))
			{
				service.deleteType(type1);
			}
			
		}
	}
}
